package cn.micro.core.exception;

/**
 * 业务异常
 */
public class BizException extends RuntimeException {

    private BizError bizError;

    public BizException(String message) {
        super(message);
    }

    public BizException(BizError bizError) {
        super("异常码：" + bizError.code() + "，异常消息：" + bizError.message());
        this.bizError = bizError;
    }

    public BizException(BizError bizError, Throwable cause) {
        super("异常码：" + bizError.code() + "，异常消息：" + bizError.message(), cause);
        this.bizError = bizError;
    }

    public BizException(Throwable cause) {
        super(cause);
    }

    public BizException(String message, Throwable cause) {
        super(message, cause);
    }

    public BizError getBizError() {
        return bizError;
    }

}
